You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default is **off** (`max_json_repair_attempts: 0`) so CI and simulated batches stay deterministic. Enable in config under `model_settings.inference.contract`:
208
+
209
+
```json
210
+
{
211
+
"model_settings": {
212
+
"inference": {
213
+
"backend": "ollama_vision",
214
+
"fallback_to_simulated": true,
215
+
"contract": {
216
+
"max_json_repair_attempts": 2,
217
+
"strict_contract": false,
218
+
"repair_on_empty_dict": true,
219
+
"repair_prompt_suffix": "Return ONLY a single JSON object with keys decision, code, msg."
220
+
}
221
+
}
222
+
}
223
+
}
224
+
```
225
+
226
+
Behavior:
227
+
228
+
- Parse/validate failures trigger up to N extra LLM calls with validation feedback (`contract_validator.py`).
229
+
- Success attaches `contract_meta.repair_attempts` on the inference dict.
230
+
- After exhausted repair: `ERR_MODEL_RESPONSE_422` + `repair_exhausted` in `msg`; may fall back to `simulated` unless `strict_contract` is true.
231
+
-`runtime.replay_mode=replay` disables repair (same as CI replay smoke).
232
+
233
+
Semantic asserts (P2) run by default via `eval_settings.semantic_asserts_enabled` (default true). Row-level issues appear in `contract.semantic_errors`; batch summary includes `semantic_assert_fail_count` and `review_breakdown.SEMANTIC_ASSERT_MISMATCH` when arbitration input is overridden.
See `tests/regression/README.md` and `docs/RegressionVersioning.md`. Rule-change drift vs committed snapshots:
252
+
253
+
```bash
254
+
python scripts/diff_oracle_semantics.py
255
+
python scripts/refresh_oracle_snapshot.py # after intentional policy change
256
+
```
257
+
258
+
CI posts a **semantic changelog** to the GitHub job summary on every run; PRs also enforce snapshot parity (`scripts/ci_oracle_semantic_summary.sh`).
259
+
260
+
**JSON repair audit:** when `contract.max_json_repair_attempts > 0`, each row gets `contract_meta.repair_audit` and `unstable_repair` if decision flips across repair rounds. Default `contract.unstable_repair_release: REVIEW` downgrades release for audit. See `docs/RepairAudit.md`, `docs/FailureTaxonomy.md` (triage **IN**).
261
+
262
+
Replay CI uses stricter KPI thresholds (`.ci/replay_quality_kpi_thresholds.json`: `max_semantic_assert_fail_count=0`).
263
+
205
264
</details>
206
265
207
266
<details>
@@ -226,12 +285,29 @@ docker run --rm \
226
285
227
286
</details>
228
287
288
+
<details>
289
+
<summary><strong>Live KPI baseline (optional, not CI)</strong></summary>
290
+
291
+
Profile `live_baseline` runs real inference + contract repair + adaptive backoff + LLM judge (Ollama). Requires a local server (`llama.cpp` on `:8080` or Ollama on `:11434`).
Record planner prompts/responses and decision-state transitions on a known-good run, then support playback-only regression mode to eliminate flaky LLM variance and reduce token spend.
Evolve from fixed semaphore limits to runtime-aware rate control (429/503 detection, exponential backoff with jitter, and temporary permit reduction) so test loops remain stable under service pressure.
283
-
355
+
-**LLM judge on REVIEW rows (P2.1)** — shipped (simulated, cost-capped); enable via `eval_settings.llm_judge.enabled`.
356
+
-**Critique Agent** — outline in `docs/CritiqueAgent.md` (assertion strength / schema coverage recommendations, not a CI gate).
Use observed response samples and Pydantic contracts to infer boundary/type assertions and scaffold `tests/test_generated_*.py` candidates, reducing manual test-authoring overhead for newly explored paths.
Implemented in `src/util/adaptive_backoff.py` and wired into `src/models/async_inference.py`.
4
+
5
+
## Purpose
6
+
7
+
When live inference backends return **429/5xx**, async batch runs can retry with exponential backoff + jitter instead of immediately falling back to simulated results.
8
+
9
+
## Config (`runtime.adaptive_backoff`)
10
+
11
+
| Key | Default | Meaning |
12
+
|-----|---------|---------|
13
+
|`enabled`|`false`| Master switch |
14
+
|`max_retries`|`2`| Extra attempts after pressure response |
0 commit comments