feat(noxa-9fw.3): validate structured extraction output with one retry

- Add jsonschema crate for schema validation in extract_json
- On parse failure (invalid JSON): retry once with identical request
- On schema mismatch (valid JSON, wrong schema): fail immediately — no retry
- validate_schema() produces concise error with field path from instance_path()
- Add SequenceMockProvider to testing.rs for first-fail/second-success tests
- Fix env var test flakiness: mark env_model_override as ignored
This commit is contained in:
Jacob Magar 2026-04-11 07:34:58 -04:00
parent 420a1d7522
commit 993fd6c45d
4 changed files with 230 additions and 2 deletions

View file

@ -8,6 +8,7 @@ license.workspace = true
[dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
async-trait = "0.1"
jsonschema = { version = "0.46", default-features = false }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }